package com.example.dezhou_puke.enums;

/**
 * @ClassName: Level
 * @Description: 描述10种牌型
 * @Author: YangGuisen
 * @Date: 2018/6/5 13:52
 * @Version: 1.0
 */
public enum  Level {

    ROYAL_FLUSH(10,"同花大顺"),
    STRAIGHT_FLUSH(9,"同花顺"),
    FOUR_OF_A_KIND(8,"四条"),
    FULLHOUSE(7,"满堂红"),
    FLUSH(6,"同花"),
    STRAIGHT(5,"顺子"),
    THREE_OF_A_KIND(4,"三条"),
    TWO_PAIRS(3,"两对"),
    ONE_PAIR(2,"一对"),
    HIGH_CARD(1,"高牌");

    /**
     * 牌型等级
     */
    private Integer level;
    /**
     * 牌型描述
     */
    private String  desc;

    Level(Integer level, String desc) {
        this.level = level;
        this.desc = desc;
    }




    public static String getLevelDesc(Integer level){
        Level[] values = Level.values();
        for (Level value : values) {
            if(value.level==level){
                return value.desc;
            }
        }
        return  null;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
